package com.len.controller;

import com.len.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.SimpleDateFormat;
import java.util.Date;

@Controller
@RequestMapping(value = "/shop/console")
@Slf4j
public class ConsoleController {

    @GetMapping("console")
    @RequiresPermissions("console:showList")
    public String showList(Model model){
        SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日");
        model.addAttribute("currentDateStr",sdf.format(DateUtil.getFrontDay(new Date(),1)));
        return "/shop/console/console";
    }

}
